import request from '@/utils/http'

export function getDeviceById (id) {
    return request({
        url: `device/${id}`,
        method: 'get',
    })
}

export function listDevices (page, pageSize) {
    return request({
        url: 'device',
        method: 'get',
        params: { page, pageSize }
    })
}

export function createDevice (data) {
    return request({
        url: 'device',
        method: 'post',
        data
    })
}

export function updateDevice (params) {
    return request({
        url: 'device',
        method: 'put',
        params: params
    })
}

export function deleteDevice (id) {
    return request({
        url: `device/${id}`,
        method: 'delete'
    })
}

export function countDeviceGroupByDeviceType() {
    return request({
        url: `device/count/groupByDeviceType`,
        method: 'get',
    })
}


